﻿using System;
using System.Threading;


namespace WJ.Infrastructure.Extension
{
    public static class ActionExtension
    {
        public static void TryAgain(this Action action, int count)
        {
            for (int i = 1; i <= count; i++)
            {
                try
                {
                    action();

                    return;
                }
                catch
                {

                    Thread.Sleep(1000);

                    action();
                }
            }
        }
    }
}